# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-builder
pkgver=3.26.1
pkgrel=1
pkgdesc="An IDE for writing GNOME-based software"
url="https://wiki.gnome.org/Apps/Builder"
arch=(i686 x86_64)
license=(GPL3)
depends=(gtksourceview3 devhelp libgit2-glib gjs python-gobject clang desktop-file-utils
         ctags libpeas vte3 vala python-jedi autoconf-archive sysprof flatpak gspell libdazzle
         template-glib jsonrpc-glib python-sphinx)
makedepends=(intltool llvm gobject-introspection gtk-doc yelp-tools appstream-glib vala git
             mm-common meson)
optdepends=('gnome-code-assistance: Legacy assistance services')
groups=(gnome-extra)
_commit=cecff18be637d185211a9b01c689827761e33483  # tags/3.26.1^0
source=("git+https://git.gnome.org/browse/gnome-builder#commit=$_commit"
        "git+https://git.gnome.org/browse/libgd"
        "git+https://git.gnome.org/browse/jsonrpc-glib"
        "git+https://git.gnome.org/browse/template-glib"
        "git+https://git.gnome.org/browse/libdazzle")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GNOME_BUILDER_//;s/_/./g;s/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
  git submodule init
  git config --local submodule.subprojects/libgd.url "$srcdir/libgd"
  git config --local submodule.subprojects/jsonrpc-glib.url "$srcdir/jsonrpc-glib"
  git config --local submodule.subprojects/template-glib.url "$srcdir/template-glib"
  git config --local submodule.subprojects/libdazzle.url "$srcdir/libdazzle"
  git submodule update
}

build() {
  cd build
  arch-meson ../$pkgname
  ninja
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
